<template>
  <div class="box">
    <div class="top_back">
      <div class="el-icon-arrow-left" @click="$router.go(-1)"></div>
      <div class="top_logo"><img src="../../../../assets/static/register/l1.png" alt=""/></div>
      <div class="card">
        <div class="card_title">
          <img src="../../../../assets/static/login/r1.png" alt=""/>
          <div>Login</div>
          <img src="../../../../assets/static/login/r2.png" alt=""/>
        </div>
        <div class="card_Phone">
          <img src="../../../../assets/static/login/p.png" alt=""/>
          <div>Phone</div>
        </div>
        <div class="card_input">
          <!--          <div>-->
          <el-select v-model="areacode" placeholder="选择区号">
            <el-option value="sG65">新加坡</el-option>
            <el-option value="+86">中国</el-option>
          </el-select>
          <!--              <img src="../../../../assets/static/login/d1.png" alt="">-->
          <!--          </div>-->
          <div><input v-model="mobile"/></div>
        </div>
        <div class="card_btn" @click="sendCode">Get code</div>
      </div>
    </div>
  </div>
</template>

<script>
import {login} from '@/api/merbership/login'
import {setToken, setReferToken} from '@/utils/tokenTools'

export default {
  data() {
    return {
      areacode: '',
      mobile: ''
    }
  },
  methods: {
    /**
     * 发送验证码
     */
    sendCode() {
      const pd = {
        phone: this.mobile,
        areacode: this.areacode
      }
      this.$router.push({path: '/listregister', query: pd})
      // sendVerify(this.$qs.stringify(pd))
      //   .then(res => {
      //     this.$message.success(res.data.msg)
      //   })
    },
    /**
     * 登录获取接口
     */
    login() {
      const pd = {
        mobile: this.account,
        code: this.password
      }
      login(this.$qs.stringify(pd))
        .then(res => {
          this.$message.success(res.data.msg)
          setReferToken(res.data.data.refer_token)
          if (setToken(res.data.data.token)) {
            this.$router.push({path: 'listhome'})
          }
        })
    }
  }
}
</script>

<style lang="scss" scoped>
.box {
  height: 100vh;
  background-color: #fff;
}

.top_back {
  background-image: url(../../../../assets/static/register/b2.png);
  background-repeat: no-repeat;
  background-size: 100%;

  .el-icon-arrow-left {
    color: #FFFFFF;
    padding: 30px 15px;
  }

  .top_logo {
    text-align: center;

    img {
      width: 263px;
    }
  }

  .card {
    margin: 15px;
    padding: 20px;
    background-color: #fff;
    box-shadow: 0 0 15px #CCCCCC;
    border-radius: 10px;

    .card_title {
      display: flex;
      justify-content: center;
      align-items: center;
      font-size: 23px;
      color: #65BE06;
      font-weight: bold;

      div {
        margin: 0 10px;
      }
    }

    .card_Phone {
      display: flex;
      align-items: center;
      font-size: 14px;
      color: #65BD06;
      font-weight: bold;
      margin: 36px 0 13px 0;

      img {
        width: 10px;
        margin-right: 6px;
      }
    }

    .card_input {

      div:nth-child(2) {
        padding: 15px;
        border-radius: 10px;
        box-shadow: 0 0 10px #ccc;
        margin: 14px 0;
        display: flex;
        align-items: center;
        font-size: 11px;

        select {
          width: 100%;
          appearance: none;
          -moz-appearance: none;
          -webkit-appearance: none;
          border: none;
          outline: none;
        }

        select::-ms-expand {
          display: none;
        }

        input {
          width: 100%;
          border: none;
          outline: none;
        }
      }
    }

    .card_btn {
      background-image: url(../../../../assets/static/register/b3.png);
      background-repeat: no-repeat;
      background-size: 100% 100%;
      width: 294px;
      text-align: center;
      font-size: 14px;
      color: #FFFFFF;
      font-weight: bold;
      padding: 25px 0 35px 0;
    }
  }
}

</style>
<style>
.el-input__inner {
  border-color: transparent;
  width: 305.2px;
  outline: none;
  height: 48px;
  border-radius: 10px;
  box-shadow: 0 0 10px #ccc;
}

.el-select .el-input.is-focus .el-input__inner {
  border-color: transparent;
  border-radius: 10px;
  box-shadow: 0 0 10px #ccc;
}

.el-select:hover .el-input__inner {
  border-color: transparent;
  border-radius: 10px;
  box-shadow: 0 0 10px #ccc;
}
</style>
